import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { User } from '../../models/User';
import { Loginauth } from '../../service/loginauth';
import { UserService } from '../../service/userService';
import { Message } from '../../models/Message';
import {tap} from 'rxjs/operators';

declare var $: any;
@Component({
  templateUrl: './insertmsg.html',
  styleUrls: ['./insertmsg.css']
})
export class InsertmsgComponent implements OnInit {
  isAdmin: boolean;
  page = 1;
  pageSize = 10;
  messages: Message[];
  total: number;
  constructor(private route: ActivatedRoute, private loginauth: Loginauth, private userService: UserService) {

  }
  ngOnInit() {
    this.loginauth.checkAdmin().subscribe((isadmin) => {
      this.isAdmin = isadmin;
    })
  }
}
